home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209s.zip / octave-2.09 / libcruft / ranlib / gennor.f < prev    next >
Text File  |  1996-07-19  |  1KB  |  55 lines

  1.       REAL FUNCTION gennor(av,sd)
  2. C**********************************************************************
  3. C
  4. C     REAL FUNCTION GENNOR( AV, SD )
  5. C
  6. C         GENerate random deviate from a NORmal distribution
  7. C
  8. C
  9. C                              Function
  10. C
  11. C
  12. C     Generates a single random deviate from a normal distribution
  13. C     with mean, AV, and standard deviation, SD.
  14. C
  15. C
  16. C                              Arguments
  17. C
  18. C
  19. C     AV --> Mean of the normal distribution.
  20. C                              REAL AV
  21. C
  22. C     SD --> Standard deviation of the normal distribution.
  23. C                              REAL SD
  24. C
  25. C     GENNOR <-- Generated normal deviate.
  26. C                              REAL GENNOR
  27. C
  28. C
  29. C                              Method
  30. C
  31. C
  32. C     Renames SNORM from TOMS as slightly modified by BWB to use RANF
  33. C     instead of SUNIF.
  34. C
  35. C     For details see:
  36. C               Ahrens, J.H. and Dieter, U.
  37. C               Extensions of Forsythe's Method for Random
  38. C               Sampling from the Normal Distribution.
  39. C               Math. Comput., 27,124 (Oct. 1973), 927 - 937.
  40. C
  41. C
  42. C**********************************************************************
  43. C     .. Scalar Arguments ..
  44.       REAL av,sd
  45. C     ..
  46. C     .. External Functions ..
  47.       REAL snorm
  48.       EXTERNAL snorm
  49. C     ..
  50. C     .. Executable Statements ..
  51.       gennor = sd*snorm() + av
  52.       RETURN
  53.  
  54.       END
  55.